<template>
  <div>
    <Button type="primary" @click="open=true">测试2</Button>
    <!-- <Submenu :visible="open" :data="items"/> -->
  
  <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100vw" height="100vh">
  <!-- <rect width="300" height="100"
  style="fill:rgb(0,0,255);stroke-width:1;stroke:rgb(0,0,0)"/> -->
  <foreignObject width="300" height="333" x="100" y="100">
  <div class="he"
            >
            <Button type="primary">ok</Button>
            </div>
  </foreignObject>
</svg>
  </div>
</template>

<script>
  export default {
    name: '',
    data() {
      return {
        open:false,
        items:[
          {
            label: `自定义样式(${this.useCustomClass ? "开" : "关"})`,
            onClick: () => {
              this.useCustomClass = !this.useCustomClass;
            },
          },
          {
            label: "返回(B)",
            onClick: () => {
              this.message = "返回(B)";
              console.log("返回(B)");
            },
          },
          { label: "前进(F)", disabled: true },
          { label: "重新加载(R)", divided: true, icon: "el-icon-refresh" },
          { label: "另存为(A)..." },
          { label: "打印(P)...", icon: "el-icon-printer" },
          { label: "投射(C)...", divided: true },
          {
            label: "使用网页翻译(T)",
            divided: true,
            minWidth: 0,
            children: [
              { label: "翻译成简体中文" },
              { label: "翻译成繁体中文" },
            ],
          },
          {
            label: "截取网页(R)",
            minWidth: 0,
            children: [
              {
                label: "返回(B)",
                onClick: () => {
                  this.message = "返回(B)";
                  console.log("返回(B)");
                },
              },
              { label: "前进(F)", disabled: true },
              { label: "重新加载(R)", divided: true, icon: "el-icon-refresh" },
              { label: "另存为(A)..." },
              { label: "打印(P)...", icon: "el-icon-printer" },
              { label: "投射(C)...", divided: true },
              {
                label: "使用网页翻译(T)",
                divided: true,
                minWidth: 0,
                children: [
                  { label: "翻译成简体中文" },
                  { label: "翻译成繁体中文" },
                ],
              },
              {
                label: "截取网页(R)",
                minWidth: 0,
                children: [
                  {
                    label: "截取可视化区域",
                    onClick: () => {
                      this.message = "截取可视化区域";
                      console.log("截取可视化区域");
                    },
                  },
                  { label: "截取全屏" },
                ],
              },
              { label: "查看网页源代码(V)", icon: "el-icon-view" },
              { label: "检查(N)" },
            ],
          },
          { label: "查看网页源代码(V)", icon: "el-icon-view" },
          { label: "检查(N)" },
        ],
      }
    }
  }
</script>

<style lang="less" >
  .he{
    background: red;
    text-align: center;
    height: 500px;
  }
</style>